const { BrowserWindow } = require('electron')


class AppWindow extends BrowserWindow {
  constructor(config,locationUrl) {
    const baseConfig = {
      width: 1024,
      height: 680,
      backgroundColor:"#efefef",
      show:false,
      webPreferences: {
        nodeIntegration: true,
        enableRemoteModule: true,
        nodeIntegrationInWorker: true
      }
    }
    const finalConfig = {...baseConfig, ...config}
    super(finalConfig);
    this.loadURL(locationUrl)
    this.once('ready-to-show',() => {
      this.show();
    })
  }
}

module.exports = AppWindow